package com.pudding.pojo;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {
    private Integer id;
    private String userCode; //用户编码
    private String userName;
    private String userPassword;
    private Integer gender; //性别
    private Date birthday; //出生日期
    private String phone;
    private String address;
    private Integer userRole;
    private Integer createBy; //创建者
    private Date creationDate; //创建时间
    private Integer modifyBy; //更新者
    private Date modifyDate; //更新时间

    private Integer age;
    private String userRoleName; //用户角色名称

    public Integer getAge() {
        Date date = new Date();
        Integer age = date.getYear()-birthday.getYear();
        return age;
    }

}
